def parse_string_to_dict(input_str,deli=" ",dict_deli=":"):
    items = input_str.split(deli)
    result_dict = {}
    for item in items:
        key, value = item.split(dict_deli)
        result_dict[key] = float(value)
    return result_dict

str1="us:24.50 ni:0.00 sy:23.50 id:39.20 io:0.00 hi:7.80 si:4.90 st:0.00"
str2="us=24.50,ni=0.00,sy=23.50,id=39.20,io=0.00,hi=7.80,si=4.90,st=0.00"
print(parse_string_to_dict(str1))
print(parse_string_to_dict(str2,deli=",",dict_deli="="))
